/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/**
* A class that (should) help in plotting B&B related data into JPEG image
*/
#ifndef BB_PLOT_UTIL_H_
#define BB_PLOT_UTIL_H_

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string>
#include <vector>
#include "BetBdtLocalizer.h"
#include "RGBImage.h"
#include "JPEGEncoder.hpp"  ///< For saving JPEG

class bbPlotUtil{
	public:
		/**
		* Constructor takes a localizer, which must be initialized (STATIC MAP)
		*/
		bbPlotUtil(CBetBdtLocalizer *glocalizer);
		~bbPlotUtil();
		
		/**
		* Stores the result into file
		*/
		void save(const char *fname);
		
		/**
		* Sets/resets the map to RGB
		*/
		void setMap();
		/**
		* Sets the measurement @meas to @pos using color
		*/
		void setMeasurement(CEnvironmentMeasurement2D &meas, Grid::pose &pos, 
																		unsigned char r,
																		unsigned char g,
																		unsigned char b);
																		
		void setMeasurement(CEnvironmentMeasurement2D &meas, Grid::pose &pos, float resolution,
																unsigned char r,
																unsigned char g,
																unsigned char b);
		/**
		* Sets a match result using weight coloring
		*/
		void setResult(CMatchStorage &matches);
		
	private:
		TOccupancyGrid *O; ///Save original map here
		RGBUtil::RGBImage *rgb;

};




#endif
